import { defHttp, jsonHttp } from '@/utils/http/axios';
import {
  chatidParams,
  deptListParams,
  deptUserListParams,
  integralListParams,
  rankingListParams,
} from './model/deptModel';
import { BasicListResult, BasicDataResult } from '../model/baseModel';

import { ErrorMessageMode } from '#/axios';

enum Api {
  //Login = '/login',
  getAllDeptList = '/hl/sys/sysData/getAllDeptList',
  deptUserList = '/hl/sys/sysData/deptUserList',
  getAllDept = '/hl/sys/sysData/getAllDept',
  syncDeptList = '/hl/sys/sysData/syncDeptList',
  queryGroupChatUsers = '/hl/sys/sysData/queryGroupChatUsers',
  integralList = '/hl/sys/sysData/integralList',
  sysRankingList = '/hl/sys/sysData/sysRankingList',
  bookUserTimeCount = '/hl/sys/sysData/bookUserTimeCount',
  cardList = '/hl/sys/sysData/cardList',
  bookPieCount = '/hl/sys/sysData/bookPieCount',
  dutyTableList = '/hl/sys/sysData/dutyTableList',
  sysUserDeduct = '/hl/sys/userManage/sysUserDeduct',
  sysUserAddReadIntegral = '/hl/sys/userManage/sysUserAddReadIntegral',
  allChatGroupList = '/hl/sys/chatGroup/allChatGroupList', //群聊下拉

  waitList = '/hl/sys/ms/mould/waitList',
  addDailyCardByDate = '/hl/sys/sysData/addDailyCardByDate', //补正常卡
  addYesCardByDate = '/hl/sys/sysData/addYesCardByDate', //补昨日卡

  importDepts = '/hl/sys/sysData/importDepts',
  myWaitList='/hl/sys/sysData/myWaitList',
  /**
   * 任职管理相关
   */
  officeUserList='/hl/sys/office/officeUserList',
  saveOfficeUser='/hl/sys/office/saveOfficeUser',
  deleteOfficeUser='/hl/sys/office/deleteOfficeUser',
  importOfficeUser='/hl/sys/office/importOfficeUser',
  importWorkYear='/hl/sys/office/importWorkYear',
  importUserSatisfaction='/hl/sys/office/importUserSatisfaction',
  syncOfficeUser='/hl/sys/office/syncOfficeUser',

  officeChangeList='/hl/sys/office/officeChangeList',

  postRequestList='/hl/sys/office/postRequestList',
  postRequestSave='/hl/sys/office/postRequestSave',
  postRequestDelete='/hl/sys/office/postRequestDelete',
  postRequestImport='/hl/sys/office/postRequestImport',
  postSpecialtyImport='/hl/sys/office/postSpecialtyImport',
  postRequestAll='/hl/sys/office/postRequestAll',
  qualifiedList='/hl/sys/office/qualifiedList',
  getQualifiedList='/hl/sys/office/getQualifiedList',
  scoreSettingList='/hl/sys/office/scoreSettingList',

  scoreSettingSave='/hl/sys/office/scoreSettingSave',
  officeSatisfactionList='/hl/sys/office/officeSatisfactionList',

  officeSatisfactionRemove='/hl/sys/office/officeSatisfactionRemove',
  officeSatisfactionSaveBatch='/hl/sys/office/officeSatisfactionSaveBatch',
}

/**
 * @description: user login api
 */
export function getAllDeptListApi(params: deptListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.getAllDeptList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function getAllDeptApi(params: deptListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.getAllDept,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function deptUserListApi(params: deptUserListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.deptUserList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function syncDeptListApi(params: deptUserListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.syncDeptList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function sysUserDeductApi(params: deptUserListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.sysUserDeduct,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

//添加积分
export function sysUserAddReadIntegralApi(
  params: deptUserListParams,
  mode: ErrorMessageMode = 'modal',
) {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.sysUserAddReadIntegral,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function queryGroupChatUsersApi(params: chatidParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.queryGroupChatUsers,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function integralListApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.integralList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function cardListApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.cardList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function dutyTableListApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.dutyTableList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function sysRankingListApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.sysRankingList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function bookUserTimeCountApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.bookUserTimeCount,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function bookPieCountApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.bookPieCount,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function waitListApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.waitList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function allChatGroupListApi(params: integralListParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.allChatGroupList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

//补正常卡
export function addDailyCardByDateApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.addDailyCardByDate,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

//补昨日卡
export function addYesCardByDateApi(params: any, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.addYesCardByDate,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function importDeptsApi(params: any, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.importDepts,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}
export function myWaitList(params:  null, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.myWaitList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function officeUserList(params:  null, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.officeUserList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function saveOfficeUser(params:  null, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.saveOfficeUser,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function deleteOfficeUser(params:  null, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.deleteOfficeUser,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function importOfficeUser(params:  null, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.importOfficeUser,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function importWorkYear(params:  null, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.importWorkYear,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function importUserSatisfaction(params:  null, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.importUserSatisfaction,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function syncOfficeUser(params:  null, mode: ErrorMessageMode = 'modal') {
  return jsonHttp.post<BasicDataResult>(
    {
      url: Api.syncOfficeUser,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}


export function officeChangeList(params:  null, mode: ErrorMessageMode = 'modal') {
  return defHttp.post<BasicDataResult>(
    {
      url: Api.officeChangeList,
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function postRequestList(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.postRequestList,params,},{errorMessageMode: mode,},);}

export function postRequestSave(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.postRequestSave,params,},{errorMessageMode: mode,},);}


export function postRequestDelete(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.postRequestDelete,params,},{errorMessageMode: mode,},);}

export function postRequestImport(params:  null, mode: ErrorMessageMode = 'modal') { return jsonHttp.post<BasicDataResult>({ url: Api.postRequestImport,params,},{errorMessageMode: mode,},);}

export function postSpecialtyImport(params:  null, mode: ErrorMessageMode = 'modal') { return jsonHttp.post<BasicDataResult>({ url: Api.postSpecialtyImport,params,},{errorMessageMode: mode,},);}


export function postRequestAll(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.postRequestAll,params,},{errorMessageMode: mode,},);}


export function qualifiedList(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.qualifiedList,params,},{errorMessageMode: mode,},);}
export function getQualifiedList(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.getQualifiedList,params,},{errorMessageMode: mode,},);}


export function scoreSettingList(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.scoreSettingList,params,},{errorMessageMode: mode,},);}


export function scoreSettingSave(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.scoreSettingSave,params,},{errorMessageMode: mode,},);}

export function officeSatisfactionList(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.officeSatisfactionList,params,},{errorMessageMode: mode,},);}

export function officeSatisfactionRemove(params:  null, mode: ErrorMessageMode = 'modal') { return defHttp.post<BasicDataResult>({ url: Api.officeSatisfactionRemove,params,},{errorMessageMode: mode,},);}


export function officeSatisfactionSaveBatch(params:  null, mode: ErrorMessageMode = 'modal') { return jsonHttp.post<BasicDataResult>({ url: Api.officeSatisfactionSaveBatch,params,},{errorMessageMode: mode,},);}
